#include <stdio.h>
#include <unistd.h>
#include <e_file.h>
#include <signal.h>

typedef void (*sighandler_t)(int);
void sig_handler (int s);
int main (void)
{
	sighandler_t ret;
	int i = 0;
	//忽略2号信号
	//signal (2, SIG_IGN);
	ret = signal (2, sig_handler);
	//忽略3号信号
	signal (3, SIG_IGN);
	//忽略9号信号
	signal (9, SIG_IGN);
	signal (19, SIG_IGN);
	printf ("pid = %d\n", getpid());
	while (1) {
		if (i == 10) {
			//signal (2, SIG_DFL);
			signal (2, ret);
		}
		i++;
		write (1, "*", 1);
		sleep (1);
	}

	return 0;
}

void sig_handler (int s) 
{
	write (1, "!", 1);
}
